#include <buola/chart/c3dseries.h>

namespace buola { namespace chart {

void C3DSeries::CalcSeries()
{
    mMin={INFINITY,INFINITY,INFINITY};
    mMax={-INFINITY,-INFINITY,-INFINITY};
    mMinPos={INFINITY,INFINITY,INFINITY};
    
    int lLength=mRows*mCols;
    
    for(int i=0;i<lLength;i++)
    {
        mMin.x()=min(mMin.x(),mXData[i]);
        mMax.x()=max(mMax.x(),mXData[i]);
        mMin.y()=min(mMin.y(),mYData[i]);
        mMax.y()=max(mMax.y(),mYData[i]);
        mMin.z()=min(mMin.z(),mZData[i]);
        mMax.z()=max(mMax.z(),mZData[i]);
        if(mXData[i]>0) mMinPos.x()=min(mMinPos.x(),mXData[i]);
        if(mYData[i]>0) mMinPos.y()=min(mMinPos.y(),mYData[i]);
        if(mZData[i]>0) mMinPos.z()=min(mMinPos.z(),mZData[i]);
    }
}

/*namespace chart*/ } /*namespace buola*/ }
